#ifndef IMGPROCESSOR_H
#define IMGPROCESSOR_H

#include <QMainWindow>

#include <QMenu>
#include <QImage>
#include <QTextCharFormat>
#include <QLabel>
#include <QToolBar>
#include <QMenuBar>
#include <QAction>
#include <QApplication>
#include <QString>
#include <QFileDialog>
#include <QTextStream>
#include <QPrinter>
#include <QPrintDialog>
#include <QTextDocument>
#include <QPainter>
#include <QSize>
#include <QRect>
#include <QMatrix>
#include "showwidget.h"
class ImgProcessor : public QMainWindow
{
    Q_OBJECT

public:
    ImgProcessor(QWidget *parent = nullptr);
    ~ImgProcessor();

    void createActions();  //创建动作
    void createMenus();         //创建菜单
    void createToolBars();  //创建工具栏
    void loadFile(QString filename);
    void mergeFormat(QTextCharFormat);
protected slots:
    void ShowNewFile();
    void ShowOpenFile();
    //打印功能
    void ShowPrintText();
    void ShowPrintImage();
    //缩放功能
    void ShowZoomIn();
    void ShowZoomOut();
    //旋转功能
    void ShowRotate90();
private:
    QMenu* fileMenu;   //各项菜单栏
    QMenu* zoomMenu;
    QMenu* rotateMenu;
    QMenu* mirrorMenu;
    QImage img;

    ShowWidget* showWidget;
    QAction* openFileAction;
    QAction* NewFileAction;
    QAction* PrintTextAction;
    QAction* PrintImageAction;
    QAction* exitAction;
    QAction* copyAction;
    QAction* cutAction;
    QAction* pasteAction;
    QAction* aboutAction;
    QAction* zoomInAction;
    QAction* zoomOutAction;
    QAction* rotate90Action;
    QAction* rotate180Action;
    QAction* rotate270Action;
    QAction* mirrorVecticalAction;
    QAction* mirrorHorizontalAction;
    QAction* undoAction;
    QAction* redoAction;

    QToolBar* fileTool;
    QToolBar* zoomTool;
    QToolBar* rotateTool;
    QToolBar* mirrorTool;
    QToolBar* doToolBar;

    QString fileName;
};
#endif // IMGPROCESSOR_H
